﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoreMVVM.ViewModels;
using GeometryViz3D.Model;

namespace GeometryViz3D.ViewModels
{
    public class ElementViewModel : ViewModelBase
    {
        public ElementViewModel(G3DElement element, IMainViewModel mainVM)
        {
            Element = element;
            MainViewModel = mainVM;
        }

        public G3DElement Element
        {
            get;
            private set;
        }

        public IMainViewModel MainViewModel
        {
            get;
            set;
        }

        public string Label
        {
            get { return Element.Label; }
            set
            {
                Element.Label = value;
                OnPropertyChanged("Label");
                RaiseModelChangedEvent();
            }
        }

        public void RaiseModelChangedEvent()
        {
            MainViewModel.RaiseModelChangedEvent();
        }
    }
}
